<template>
  <van-nav-bar
    :title="title"
    left-arrow
    :left-text="text"
    @click-left="onClickLeft"
  >
    <template #right>
      <div @click="clicks" v-if="cityName != ''">
        <van-icon name="location-o" />
        <span class="rights">{{ cityName }} <span v-if="areaName!=''">/</span>   {{areaName }}</span>
      </div>
    </template></van-nav-bar
  >
</template>

<script>
import { NavBar } from "vant";
import Vue from "vue";
Vue.use(NavBar);
export default {
  data() {
    return {};
  },
  props: {
    title: String,
    text: String,
    cityName: String,
    SeveralMenus:String,
    areaName:String
  },

  components: {},

  computed: {},

  methods: {
    onClickLeft() {
      if(this.SeveralMenus=='1'){
        this.$router.push('/home')
    
      }else{
        this.$router.go(-1);
      }
      this.$toast.clear();
    },
    clicks() {
      this.$emit("clicksPopul");
    },
  },
};
</script>
<style scoped></style>
